<template>
	<div class="set flex">
		<div class="tabFlex flex">
			<div class="item" @click="tab.index = index" v-for="(item, index) in tab.list" :class="tab.index === index ? 'active' : ''">{{ item.name }}</div>
			<div class="border" :style="{ left: `calc(${tab.index * 100 }px + ${tab.index * 10}px)` }"></div>
		</div>
		<template v-if="tab.index === 0">
			<div class="avatar flex">
				<img src="https://api.sora13.com/download/20240617/avatar66703958f152d403740.png" />
				<div class="changeAvatar ell">更换头像</div>
			</div>
			<div class="blockDiv" style="margin-top: 20px;">
				<h3>昵称</h3>
				<div class="inlineDiv">
					<input placeholder="请输入你的昵称" type="text" />
				</div>
			</div>
			<div class="blockDiv" style="margin-top: 30px;">
				<h3>一句话介绍</h3>
				<div class="inlineDiv">
					<textarea placeholder="简单介绍一下你自己吧" />
				</div>
			</div>
			<div class="switchFlex flex">
				<div class="left">公开自己的歌曲</div>
				<div class="right iconfont icon-zhengque"></div>
			</div>
			<div class="saveBtn">保存信息</div>
		</template>
		<template v-if="tab.index === 1">
			<div class="_div-m flex">
				<div class="_left flex">
					<p class="default_text">登录手机</p>
					<h3>15696586164</h3>
				</div>
				<div class="_right flex">
					<a class="button-active" @click="$refs.changeMobile.open()">修改</a>
				</div>
			</div>
			<div class="_div-m flex">
				<div class="_left flex">
					<p class="default_text">
						<img src="/img/8Ap.png" />微信
					</p>
					<h3>未绑定</h3>
				</div>
				<div class="_right flex">
					<a class="button-active">去绑定</a>
				</div>
			</div>
			<p class="bind_notice">绑定第三方平台是为了更加方便的登录本平台，平台本身不记录任何信息</p>
		</template>
		<changeMobile ref="changeMobile" />
	</div>
</template>

<script>
	export default {
		layout: 'index',
		head() {
			return {
				title: "我的设置 - AI音乐生成 | Suno AI音乐 | 专业生成音乐 创作平台",
				meta: [
					{
						name: 'description',
						content: 'AI音乐生成 - Suno AI音乐 | 专业生成音乐 创作平台'
					}
				]
			}
		},
		data() {
			return {
				
				// 导航选项卡
				tab: {
					index: 0,
					list: [
						{ name: "基本信息", key: "basic" },
						{ name: "账号绑定", key: "bind" }
					]
				},
				
			}
		},
		asyncData({ app }) {
			
		},
		mounted(){
			
		},
	}
</script>

<style lang="scss" scoped>
	.set{
		flex-direction: column;
		width: 700px;
		max-width: 100%;
		margin: 0 auto;
		padding: 40px 25px;
		.tabFlex{
			margin-left: -10px;
			margin-bottom: 35px;
			width: 100%;
			flex-direction: row;
			align-items: center;
			position: relative;
			.item{
				width: 100px;
				cursor: pointer;
				font-size: 16px;
				color: rgba(255,255,255,0.6);
				margin-right: 10px;
				text-align: center;
				line-height: 55px;
				transition: 0.2s all;
				&.active{
					font-size: 17px;
					color: #ebf8ff;
				}
			}
			.border{
				transition: 0.2s all;
				margin-left: 10px;
				width: 80px;
				height: 2px;
				border-radius: 10px;
				background: #ebf8ff;
				position: absolute;
				bottom: 0;
				left: 0;
			}
		}
		.avatar{
			flex-direction: row;
			align-items: center;
			justify-content: center;
			width: 100px;
			height: 100px;
			margin: 0 auto;
			border: 4px solid rgba(255,255,255,0.12);
			background: rgba(255,255,255,0.12);
			border-radius: 50%;
			position: relative;
			.changeAvatar{
				border-radius: 50%;
				background: rgba(0,0,0,0.55);
				text-align: center;
				color: #FFF;
				font-size: 16px;
				line-height: 110px;
				width: 100%;
				height: 100%;
				position: absolute;
				opacity: 0;
				transition: 0.2s all;
				cursor: pointer;
			}
			img{
				width: 100%;
				height: 100%;
				border-radius: 50%;
			}
			&:hover{
				.changeAvatar{
					opacity: 1;
				}
			}
		}
		.blockDiv{
			h3{
				font-size: 16px;
				color: #ebf8ff;
				line-height: 30px;
				font-weight: 300;
			}
			.inlineDiv{
				margin-top: 12px;
				position: relative;
				overflow: hidden;
				input{
					line-height: 52px;
					display: block;
					width: 100%;
					padding: 0 15px;
					border-radius: 6px;
					transition: 0.2s all;
					font-size: 16px;
					outline: none;
					border: 0;
					color: #FFF;
					font-weight: normal;
					background: #181b21;
					&::placeholder {
						color: rgba(255,255,255,0.35);
					}
				}
				textarea{
					line-height: 28px;
					display: block;
					width: 100%;
					height: 150px;
					padding: 15px 20px;
					border-radius: 6px;
					transition: 0.2s all;
					font-size: 16px;
					outline: none;
					border: 0;
					color: #FFF;
					font-weight: normal;
					background: #181b21;
					resize: none;
					&::placeholder {
						color: rgba(255,255,255,0.35);
					}
					&:hover {&::-webkit-scrollbar-track,&::-webkit-scrollbar-thumb {visibility: visible;}}
					&::-webkit-scrollbar {width: 3px;height: 3px;}
					&::-webkit-scrollbar-track,
					&::-webkit-scrollbar-thumb {border-radius: 999px;border: 0px solid transparent;visibility: hidden;}
					&::-webkit-scrollbar-track {box-shadow: 1px 1px 5px rgba(100, 100, 100, 0.2) inset;}
					&::-webkit-scrollbar-thumb {min-height: 0px;background-clip: content-box;box-shadow: 0 0 0 5px rgba(100, 100, 100, 0.5) inset;}
					&::-webkit-scrollbar-corner {background: transparent;}
				}
			}
		}
		.switchFlex{
			flex-direction: row;
			align-items: center;
			margin-top: 30px;
			cursor: pointer;
			.left{
				font-weight: 300;
				font-size: 16px;
				color: #ebf8ff;
				line-height: 30px;
			}
			.right{
				border: 1px solid rgba(255,255,255,0.22);
				height: 20px;
				width: 20px;
				line-height: 20px;
				text-align: center;
				font-size: 12px;
				color: #ebf8ff;
				margin-left: 13px;
				border-radius: 4px;
				transition: 0.2s all;
			}
			&:hover{
				.right{
					border: 1px solid rgba(255,255,255,0.52);
				}
			}
		}
		.saveBtn{
			width: 100%;
			text-align: center;
			font-weight: bold;
			font-size: 17px;
			line-height: 53px;
			border-radius: 60px;
			margin: 0 auto;
			margin-top: 42px;
			transition: 0.2s all;
			background: #01dddc;
			color: #000;
			cursor: pointer;
			&:hover{
				opacity: 0.8;
			}
		}
		._div-m{
			flex-direction: row;
			justify-content: space-between;
			border-bottom:1px solid rgba(255,255,255,0.045);
			padding:26px 0;
			._left{
				flex-direction: row;
				line-height:38px;
				p{
					font-size: 16px;
					width:100px;
					color: rgba(255,255,255,0.5);
					img{
						width:25px;
						height:25px;
						vertical-align: middle;
						margin-right:10px;
						margin-top:-1px;
					}
				}
				h3{
					margin-left: 20px;
					font-size: 17px;
					color: #ebf8ff;
				}
			}
			._right{
				flex-direction: row;
				align-items: center;
				a{
					border-radius: 100px;
					font-size: 15px;
					color: #97c1ef;
					display: block;
					line-height: 35px;
					height: 35px;
					width: 95px;
					text-align:center;
					cursor: pointer;
					margin-left:17px;
					transition: 0.2s all;
					background: rgba(255,255,255,0.07);
					cursor: pointer;
					&:hover{
						opacity: 0.8;
					}
				}
			}
		}
		.bind_notice{
			font-size:15px;
			margin-top:20px;
			line-height:30px;
			color: rgba(255,255,255,0.5);
		}
	}
</style>